<?php

/**
 * contact : 刘经理 19326416371
 * company : 版权所属 四川北星惯牌科技有限公司
 **/

namespace app\admin\model\user;

use think\Model;


class TeamComment extends Model
{

    

    

    // 表名
    protected $name = 'user_team_comment';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = false;

    // 定义时间戳字段名
    protected $createTime = false;
    protected $updateTime = false;
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'delete_text'
    ];
    

    
    public function getDeleteList()
    {
        return ['0' => __('Delete 0'), '1' => __('Delete 1')];
    }


    public function getDeleteTextAttr($value, $data)
    {
        $value = $value ? $value : (isset($data['delete']) ? $data['delete'] : '');
        $list = $this->getDeleteList();
        return isset($list[$value]) ? $list[$value] : '';
    }




    public function user()
    {
        return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
    }


    public function team()
    {
        return $this->belongsTo('app\admin\model\Team', 't_id', 't_id', [], 'LEFT')->setEagerlyType(0);
    }
}
